<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="keywords" content="国电南自信息化创新杯设计大赛, 国电南自大赛,2020国电南自大赛,2020国电南自信息化创新杯设计大赛  ">
  <meta name="viewport" content="width=device-width, initial-scale=0.3, maximum-scale=1.0, minimum-scale=0.3, user-scalable=yes">
  <title>国电南自信息化创新杯设计大赛</title>
  <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  <style>
    * {
      margin: 0;
      padding: 0;
    }
    html,body{
      min-width: 1200px;
    }

    #banner {
      width: 100%;
    }

    img {
      display: block;
    }

    .Content {
      min-width: 1200px;
    }

    .theme {
      margin: 112px auto 102px;
    }

    .requirement {
      box-sizing: border-box;
      padding: 56px 0 133px 0;
      background-color: rgb(243, 245, 247);
    }

    .require {
      margin: 0 auto;
    }

    .ppt {
      margin: 133px auto 0;
    }

    .schedule {
      margin: 138px auto 0;
    }

    .prizeSetting {
      margin: 205px auto 0;
    }

    .prize {
      box-sizing: border-box;
      margin-top: 63px;
      width: 100%;
      padding: 89px 0 104px 0;
      background-color: rgb(243, 245, 247);
    }

    .prizeItems {
      margin: 0 auto;
    }

    .boleProject {
      margin: 132px auto 0;
    }

    .tranningPlan {
      margin: 198px auto 0;
    }

    .talentTranningPlan {
      box-sizing: border-box;
      width: 100%;
      margin-top: 67px;
      padding: 34px 0 26px 0;
      background-color: rgb(243, 245, 247);
    }

    .talentTranningPlanImg {
      margin: 0 auto;
    }

    .entrance {
      margin: 131px auto 0;
    }
    .QR-Code{
      margin: 131px auto 0;
    }

    .group {
      display: block;
      width: 100%;
      height: 38px;
      margin: 88px auto 0;
      font-family: 'NotoSansCJKsc-Medium';
      font-size: xx-large;
      text-align: center;
    }

    #form {
      margin: 0 auto;
      width: 1076px;
    }

    .formOne {
      width: 100%;
      margin: 58px auto;
    }

    .formTwo {
      width: 100%;
      margin: 58px auto;
    }

    .formThree {
      width: 100%;
      margin: 58px auto;

    }

    .inputAndSelect {
      border: solid 1px #666666;
      display: block;
      box-sizing: border-box;
      width: 100%;
      height: 81px;
      margin: 9px auto 0;
      font-family: 'NotoSansCJKsc-Medium';
      font-weight: normal;
      font-size: medium;
      text-indent: 2em;
    }

    #banner.copyright {
      margin-top: 128px;
    }

    .submit {
      margin: 98px auto 0px;
    }

    .up {
      position: fixed;
      bottom: 196px;
      right: 122px;
      display: none;
    }
    .submissionChannle{
      margin: 131px auto 0;
    }
    .submitContent{
      box-sizing: border-box;
      width: 100%;
      margin-top: 58px;
      padding-top: 58px;
      background-color: rgb(243, 245, 247);
    }
    .submissionRules{
      margin: 0 auto;
    }
    .fastSubmit{
      margin: 131px auto;
    }
  </style>
</head>

<body>
  <a name="target"><img id="banner" src="./imgs/banner.png" alt=""></a>
  <img class="theme" src="./imgs/competitionTheme.png" alt="">
  <div class="requirement">
    <img class="require" src="./imgs/entryRequirement.png" alt="">
  </div>
  <img id="banner" src="./imgs/bannerDream.png" alt="">
  <img class="ppt" src="./imgs/ppt.png" alt="">
  <img class="schedule" src="./imgs/compettionSchedule.png" alt="">
  <img class="prizeSetting" src="./imgs/prizeSetting.png" alt="">
  <div class="prize">
    <img class="prizeItems" src="./imgs/prizeItems.png" alt="">
  </div>
  <img class="boleProject" src="./imgs/boleProject.png" alt="">
  <img class="tranningPlan" src="./imgs/tranningPlan.png" alt="">
  <div class="talentTranningPlan">
    <img class="talentTranningPlanImg" src="./imgs/talentTranningPlanImg.png" alt="">
  </div>
  <img class="entrance" src="./imgs/entrance.png" alt="">
  <img class="QR-Code" src="./imgs/QR-Code.png" alt="">
  <div id="form">
    <div class="formOne">
      <input class="inputAndSelect name" type="text" placeholder="姓名" />
      <input class="inputAndSelect phone" type="phone" placeholder="手机号" />
      <input class="inputAndSelect email" type="text" placeholder="电子邮箱" />
      <select class="inputAndSelect" name="第一学历">
        <option class="opts" value="" style="display: none;" selected>第一学历</option>
        <option class="opts" value="本科">本科</option>
        <option class="opts" value="硕士">硕士</option>
        <option class="opts" value="博士">博士</option>
      </select>
      <input class="inputAndSelect campus" type="text" placeholder="毕业院校" value="请先选择学历" disabled />
      <input class="inputAndSelect major " type="text" placeholder="专业名称" value="请先选择学历" disabled />
    </div>
    <div class="formTwo">
      <select class="inputAndSelect" name="" id="">
        <option value="" style="display: none;" selected>第二学历(选填)</option>
        <option value="本科">本科</option>
        <option value="硕士">硕士</option>
        <option value="博士">博士</option>
      </select>
      <input class="inputAndSelect campus" type="text" placeholder="毕业院校" value="请先选择学历" disabled />
      <input class="inputAndSelect major " type="text" placeholder="专业名称" value="请先选择学历" disabled />
    </div>
    <div class="formThree">
      <select class="inputAndSelect" name="" id="">
        <option value="" style="display: none;" selected> 第三学历(选填)</option>
        <option value="本科">本科</option>
        <option value="硕士">硕士</option>
        <option value="博士">博士</option>
      </select>
      <input class="inputAndSelect campus" type="text" placeholder="毕业院校" value="请先选择学历" disabled />
      <input class="inputAndSelect major " type="text" placeholder="专业名称" value="请先选择学历" disabled />
    </div>

  </div>
  <img class="submit" src="./imgs/submit.png" alt="">
  <img class="up" src="./imgs/returnTop.png" alt="">
  <img class="submissionChannle" src="./imgs/submissionChannle.png" alt="" >
  <div class="submitContent">
    <img class="submissionRules" src="./imgs/submissionRules.png" alt="">
    <a href="mailto:1051933965@qq.com?subject=国电南京大赛报名&body=姓名：%0d%0a手机号：%0d%0a毕业院校：%0d%0a参赛作品请按照规则文件命名：姓名+赛题+项目名称%0d%0a文件格式请提供PDF or PPT格式"><img class="fastSubmit" src="./imgs/fastSubmit.png" alt=""></a>
  </div>
  <img id="banner" class="copyRight" src="./imgs/copyRight.png" alt="">
  <div style="display: none;"><script type="text/javascript" src="https://s9.cnzz.com/z_stat.php?id=1279074442&web_id=1279074442"></script></div>
</body>
<script>
  $('.submit').on('click', function () {
    var name = $('input.name').val()
    var phone = $('input.phone').val()
    var email = $('input.email').val()
    var degree = [{
      degree: $('.formOne select').val(),
      major: $('.formOne .major').val(),
      campus: $('.formOne .campus').val()
    }, {
      degree: $('.formTwo select').val(),
      major: $('.formTwo .major').val(),
      campus: $('.formTwo .campus').val()
    }, {
      degree: $('.formThree select').val(),
      major: $('.formThree .major').val(),
      campus: $('.formThree .campus').val()
    }]
      // .filter(function(item) {
      //   return Boolean(item.degree)
      // })
      .map(function (item) {
        return {
          degree: item.degree,
          major: item.major === '请先选择学历' ? '' : item.major,
          campus: item.campus === '请先选择学历' ? '' : item.campus
        }
      })

      console.log(degree)

    if (name && phone && email && degree[0] && degree[0].degree && degree[0].major && degree[0].campus) {
      // 全部填写
      $.post(
        'https://evp.51job.com/51job/api/1.0/index.php/gdnj/student/add', {
        name: name,
        phone: phone,
        email: email,
        education_1: degree[0].degree,
        graduate_institution_1: degree[0].campus,
        specialty_1: degree[0].major,
        education_2: degree[1].degree || '',
        graduate_institution_2: degree[1].campus || '',
        specialty_2: degree[1].major || '',
        education_3: degree[2].degree || '',
        graduate_institution_3: degree[2].campus || '',
        specialty_3: degree[2].major || ''
      },
        function (res) {
          console.log(res)
          if (res.code == 1) {
            alert('报名成功')
          }else if(res.code ==27){
            alert('请勿重复提交')
          }else {
            console.log('失败')
            alert('报名失败')
          }
        }
      )
    } else {
      // 有漏填
      alert('请填写完整的报名信息')
    }
  })

  $('select').on('change', function () {
    if ($(this).val().indexOf('学历') < 0) {
      $(this).siblings('.campus, .major').removeAttr('disabled').val('')
    } else {
      $(this).siblings('.campus, .major').addAttr('disabled').val('')
    }
  })


  var $topBtn = $('.up')
  window.onscroll = function () {
    if (window.scrollY > 707) {
      $topBtn.fadeIn()
    } else {
      $topBtn.fadeOut()
    }
  }
  $topBtn.click(function () {
    window.scrollTo({
      top: 0,
      behavior: "smooth"
    });
  })
</script>
</html>